package cn.qh.com.annotationverification;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.regex.Pattern;

//如果是在属性上的那么注解旁边的属性就要改为属性的类型
public class SortAnnotationConfig implements ConstraintValidator<AnnotationSort, Integer> {
    @Override
    public void initialize(AnnotationSort constraintAnnotation) {

    }

    @Override
    public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
        return (value == null || value < 0) ? false : true;
    }
}
